﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace WYT.Usr.Repository.Entities
{
    /// <summary>
    /// 用户钱包日志
    /// </summary>
    [Table("usr_walletLog"), Comment("钱包日志")]
    public class WalletLog : EfEntity
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Comment("用户ID")]
        public long UserId { get; set; }

        /// <summary>
        /// 变化类型 1:提现；2:收益；3:消费; 4:线上调整; 5:转出 6:退款
        /// </summary>
        [Comment("变化类型(1:提现；2:收益；3:消费; 4:线上调整; 5:转账 6:退款")]
        public int Mode { get; set; }

        /// <summary>
        /// 钱包类型（1、余额，2、购物金）")
        /// </summary>
        [Comment("钱包类型（1、余额，2、购物金）")]
        public int WalletType { get; set; }

        /// <summary>
        /// 变化方式 1、增加；-1、减少
        /// </summary>
        [Comment("变化方式 1、增加；-1、减少")]
        public int ChangeMode { get; set; }

        /// <summary>
        /// 变化金额(绝对值)
        /// </summary>
        [Comment("变化金额(绝对值)"), Column(TypeName = "decimal(18,2)")]
        public decimal ChangeAmount { get; set; }

        /// <summary>
        /// 变化金额
        /// </summary>
        [Comment("变化金额"), Column(TypeName = "decimal(18,2)")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 余额变化金额
        /// </summary>
        [Comment("变化前金额"), Column(TypeName = "decimal(18,2)")]
        public decimal ChangeFrontMoney { get; set; }


        /// <summary>
        /// 变化后金额
        /// </summary>
        [Comment("变化后金额"), Column(TypeName = "decimal(18,2)")]
        public decimal ChangeLaterMoney { get; set; }

        /// <summary>
        /// 变化前钱包镜像
        /// </summary>
        [Comment("变化前钱包镜像"), MaxLength(200)]
        public string ChangeFrontImage { get; set; }

        /// <summary>
        /// 变化后钱包镜像
        /// </summary>
        [Comment("变化后钱包镜像"), MaxLength(200)]
        public string ChangedLaterImage { get; set; }

        /// <summary>
        /// 变化后金额
        /// </summary>
        [Comment("描述"), MaxLength(200)]
        public string Describe { get; set; }

        /// <summary>
        /// 关联单据ID Mode的值不同对应的来源也不同 1:usr_WithdrawalsRecord.Id 2:usr_userCommission.Id  3:ord_order.Id  4:usr_walletChangeApply.Id  5:usr_transferAccountsLog.Id 6:ord_order.Id
        /// </summary>
        [Comment("关联单据ID Mode的值不同对应的来源也不同 1:usr_WithdrawalsRecord.Id 2:usr_userCommission.Id  3:ord_order.Id  4:usr_walletChangeApply.Id  5:usr_transferAccountsLog.Id 6:ord_order.Id")]
        public long? SourceOrder { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }
}
